package com.easylinkin.linkappapi.progress.controller;

import com.easylinkin.linkappapi.progress.entity.ProgressImageSet;
import com.easylinkin.linkappapi.progress.entity.vo.ProgressImageSetVo;
import com.easylinkin.linkappapi.progress.service.ProgressImageSetService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import site.morn.rest.RestBuilders;
import site.morn.rest.RestMessage;

import java.util.List;

/**
 * 进度管理/统计设置
 * @author: kan yuanfeng
 * @Date: 2023/04/04 11:42
 * @Description: 形象进度-统计设置管理
 */
@RestController
@RequestMapping("progressImageSet")
@Api(tags = "形象进度-统计设置管理")
@Slf4j
public class ProgressImageSetController {
  
  @Autowired
  private ProgressImageSetService progressImageSetService;

  /**
   * @Description: 增加形象进度-统计设置
   * @author kan yuanfeng
   * @date 2023/04/04 11:42
   */
  @PostMapping
  @ApiOperation("增加形象进度-统计设置")
  public RestMessage insertList(@RequestBody List<ProgressImageSet> progressImageSets){
    progressImageSetService.insertList(progressImageSets);
    return RestBuilders.successBuilder().build();
  }

  /**
   * @Description: 查询统计设置
   * @author kan yuanfeng
   * @date 2023/04/04 11:42
   */
  @GetMapping("list")
  @ApiOperation("查询统计设置")
  public RestMessage queryList(){
    List<ProgressImageSetVo> record = progressImageSetService.queryList();
    return RestBuilders.successBuilder().data(record).build();
  }
}

